package com.gdc.cloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description: 请求配置类 Controller
 *
 * | @RefreshScope                          支持Nacos的动态刷新功能
 *
 * @author: gdc
 * @date: 2021/2/7
 * @version 1.0
 */
@RestController
@RefreshScope
public class ConfigClientController {

    /**
     * 获取配置信息参数
     */
    @Value("${config.info}")
    private String configInfo;

    /**
     * 获取配置信息数据
     * @return                  结果
     */
    @GetMapping("/config/info")
    public String getConfigInfo() {
        return configInfo;
    }
}